package com.system.blogUser.common.controller;

import com.system.blogUser.common.entity.BlogContent;
import com.system.blogUser.common.service.BlogContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.List;

/**
 * 作者： cnc
 * 创建时间：2017-09-25.
 * 版本：1.0
 */
@Controller
@RequestMapping(value = "/myblog")
public class BlogContentController {

    @Autowired
    BlogContentService blogContentService;

    @RequestMapping(value = "/index/{id}",method = RequestMethod.GET,produces = "application/json;charset=utf-8;")
    public String getBlogContent(@PathVariable Long id,Model model){
        BlogContent blogContent = blogContentService.getById(id);
        model.addAttribute("blogContent",blogContent);
        return  "blogUser/index/new";
    }
}
